package com.itzh.factory.simple;

import com.itzh.factory.MenNiu;
import com.itzh.factory.Milk;
import com.itzh.factory.Telunsu;
import com.itzh.factory.YiLi;

public class SimpleFactory {

    public Milk getMilk(String name){
        if("嗨皮".equals(name)){
            return new Telunsu();
        }else if("伊利".equals(name)){
            return new YiLi();
        }else if("蒙牛".equals(name)){
            return new MenNiu();
        }
        return null;
    }
}
